using System;
using System.Collections.Generic;
using System.Linq;
using SkypeStudio.Framework;
using SkypeStudio.Controls.Views;
using System.Windows.Input;
using SkypeStudio.Controls.Services;

namespace SkypeStudio.Controls.ViewModels
{
    public class SkypeToolBarViewModel : ViewModelBase<ISkypeToolBarView>, IDisposable
    {

        private  ISkypeApplicationService _SkypeService;
        public SkypeToolBarViewModel(ISkypeToolBarView view, ISkypeApplicationService skypeService)
            : base(view)
        {
            _SkypeService = skypeService;

        }

        private ICommand _AddContactCommand;
        public ICommand AddContactCommand
        {
            get
            {
                if (_AddContactCommand == null)
                {
                    _AddContactCommand = new RelayCommand(AddContact);
                }
                return _AddContactCommand;
            }

        }

        private ICommand _SearchFriendCommand;
        public ICommand SearchFriendCommand
        {
            get
            {
                if (_SearchFriendCommand == null)
                {
                    _SearchFriendCommand = new RelayCommand(SearchFriend);
                }
                return _SearchFriendCommand;
            }

        }

        private ICommand _JoinCallCommand;
        public ICommand JoinCallCommand
        {
            get
            {
                if (_JoinCallCommand == null)
                {
                    _JoinCallCommand = new RelayCommand(JoinCall, (o) => { return false; });
                }
                return _JoinCallCommand;
            }

        }


        private ICommand _ShareCommand;
        public ICommand ShareCommand
        {
            get
            {
                if (_ShareCommand == null)
                {
                    _ShareCommand = new RelayCommand(ShareFile, (o) => { return false; });
                }
                return _ShareCommand;
            }

        }

        public void AddContact(object param)
        {
            _SkypeService.OpendAddContactDialog();
        }

        public void SearchFriend(object param)
        {
            _SkypeService.OpendSearchFriendDialog();
        }

        public void JoinCall(object param)
        {
            //_SkypeService.JoinCall();
        }
        public void ShareFile(object param)
        {
           // _SkypeService.OpendShareFileDialog();
        }


        public void Dispose()
        {
            if (this._SkypeService != null)
            {
                this._SkypeService = null;
            }
        }
    }
}
